import {
    followUp,
    centerEdit,
    formTimeLine,
    formInput,
    centerHeader,
    centerEditPad,
    input
} from '@/css/DialogsCss.module.scss';
export default {
    title:'新增记录',
    dialog:{
        size:'50%'
    },
    onMounted: [{
        action:'print',
        value:'$params'
    },{
        action:'set',
        target: '$view',
        field:'title',
        value:'$params.title'
    },{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.form'
    }],
    items: [{
        region: 'center',
        class: followUp,
        layout: 'vertical',
        items: [{
            class: [centerEdit, centerEditPad],
            layout: 'vertical',
            items: [{
                id: 'form',
                widget: 'form',
                layout: {
                    type:'gridform',
                    column:2
                },
                fields:[{
                    class: input,
                    itemId:'name',
                    widget: 'text',
                    // print: true,
                    // widget:'select',
                    // dictionary: 'common/dictionary/customer',
                    label:'客户(公司)',
                },{
                    class: input,
                    itemId:'salesman',
                    widget: 'text',
                    // print: true,
                    // widget:'select',
                    // dictionary: 'common/dictionary/customer',
                    label:'销售联系人',
                },{
                    class: input,
                    itemId:'contact',
                    placeholder:'请输入客户联系人',
                    widget:'text',
                    label:'客户联系人',
                },{
                    class: input,
                    itemId:'phone',
                    placeholder:'请输入手机号码',
                    widget:'text',
                    label:'手机号码',
                },{
                    class: input,
                    itemId:'contents',
                    placeholder:'请输入沟通内容',
                    widget:'text',
                    label:'沟通内容',
                },{
                    class: input,
                    itemId: 'create_time',
                    placeholder:'请选择回访时间',
                    widget:'form-datepicker',
                    type: 'date',
                    label:'回访时间',
                }],
                buttons: [{
                    value: '保存',
                    type: 'primary',
                    onClick: [{
                        action: 'confirm',
                        title: '表单保存',
                        message: '是否保存表单?',
                        confirm: [{
                            var:'value',
                            target:'$widget',
                            action:'call',
                            method:'getValue'
                        },{
                            action: 'service',
                            path: 'crm/customer/save',
                            params: '$vars.value'
                        },{
                            action:'dialog-hide',
                            mode:'apply'
                        }]
                    }]
                }],
            }],
        },{
            class: [centerEdit, formTimeLine, centerHeader],
            items:[{ 
                class: formInput,
                id: 'title',
                widget: 'public-title',
                title: '跟进记录',
            },{
                class: centerEditPad,
                id: 'timeline',
                widget: 'data-timeline',
                field: 'items',
                enableCard:true,
                enableTitle:false,
                placement:'top',
                items: [{
                    timestamp: '2018-04-15',
                    size: 'large',
                    type: 'primary',
                    text:"2018-04-15于客户联系人进行对接"
                },{
                    timestamp: '2018-04-13',
                    hollow: true,
                    color: '#0bbd87',
                    text:"2018-04-13于客户联系人进行对接"
                },{
                    timestamp: '2018-04-11',
                    hollow: true,
                    text:"2018-04-11于客户联系人进行对接",
                }],
                flex: true
            }]
        }]
    }]
};




